<?php

class Url {

  public static function redirect($uri, $params = NULL){
    $url =  self::build($uri, $params);
    @header('location: '.$url);
    exit;
  }

  public static function build($uri, $params = NULL) {
    $path = '';
    if($params){
      foreach($params as $key=>$value){
        $path .= '/'. $key .'/' . $value;
      }
    }
    return BASE_URL . $uri . $path;
  }

}